package com.wisdytech.linkdcs;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;

/**
 * spring boot启动类
 */
@SpringBootApplication(scanBasePackages="com.wisdytech")
@EnableTransactionManagement //事务支持
@MapperScan("com.wisdytech.linkdcs.**.dao**")
@EnableScheduling //定时任务支持
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableAsync
public class Application {
	
	
	@Autowired  
    private RestTemplateBuilder builder;  
  
        // 使用RestTemplateBuilder来实例化RestTemplate对象，spring默认已经注入了RestTemplateBuilder实例  
    @Bean  
    public RestTemplate restTemplate() {  
        return builder.build();  
    }  
	    
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
}
